import { request } from 'umi';

export interface MajorListItem {
  majorId: number;
  majorName: string;
  majorCode: string;
  majorCategory: string;
  status: string;
  createBy?: string;
  createTime?: string;
  updateBy?: string;
  updateTime?: string;
  remark?: string;
}

export async function getMajorList(params?: any) {
  return request('/major/list', {
    method: 'GET',
    params,
  });
}

export async function addMajor(data: Partial<MajorListItem>) {
  return request('/major', {
    method: 'POST',
    data,
  });
}

export async function updateMajor(data: Partial<MajorListItem>) {
  return request('/major', {
    method: 'PUT',
    data,
  });
}

export async function deleteMajor(majorId: number) {
  return request(`/major/${majorId}`, {
    method: 'DELETE',
  });
} 